package java67_adv10.inner;

import java.util.Date;

public class Hotel {// 宾馆
	private String name;
	private String addr;
	private String tele;
	protected Zhizhao zhao;

	public void show() {
		System.out.println(name + "," + addr + "," + tele);
		System.out.println("执照信息:" + zhao.no + "," + zhao.start);
	}

	// 直接访问外部类的方法和属性
	public class Zhizhao {
		private String no;
		private String start;
		private String end;

		public Zhizhao() {

		}

		public Zhizhao(String no, String start, String end) {
			super();
			this.no = no;
			this.start = start;
			this.end = end;
		}

		public void show() {
			// 每一个内部类都持有一个外部类的对象
			// 外部类名.this访问
			System.out.println("编号:" + no + ",起止是从" + start + "到" + end);
			Hotel.this.show();/// !!!!!
		}
	}

	// 方法内部类
	public void clean(String roomNo) {
		Date d = new Date();
		class Cleaner {// 吸尘器
			String brand;
			int watt;

			public void doWork() {
				System.out.println("时间是" + d);
				System.out.println("清洁房间号:" + roomNo);
			}
		}
		Cleaner c = new Cleaner();
		c.brand = "美的吸尘器";
		c.watt = 35;
		System.out.println("保洁人员在打扫");
		c.doWork();
		Cleaner c2 = new Cleaner();
	}

	// static 内部类
	public static class TigerMachine {

	}
}
